{
  let str1 = 'hello'
  const str2 = 'world'

  // 需求: 定义一个函数, 用于改变方向 up/down/left/right
  type Direction = 'up' | 'down' | 'left' | 'right'
  function changeDirection(direction: Direction) {
    console.log('方向改变了', direction)
  }

  changeDirection('down')

  let gender: '男' | '女' = '男'
  gender = '女'
}
